export default function () {
	return {
		// #ifndef H5
		toPay(type, options) {
			return new Promise((success, fail) => {
				uni.requestPayment({
					provider: type || "wxpay", // alipay wxpay
					// #ifdef MP-ALIPAY || APP-PLUS || MP-BAIDU || MP-TOUTIAO
					orderInfo: options.orderInfo,
					// #endif

					// #ifdef MP-WEIXIN
					timeStamp: options.timeStamp,
					nonceStr: options.nonceStr,
					package: options.package,
					signType: options.signType,
					paySign: options.paySign,
					// #endif

					// #ifdef MP-TOUTIAO
					service: 5,
					_debug: this.isDev ? 1 : 0,
					// #endif

					success,
					fail,
				})
			})
		},
		// #endif
	}
}
